package org.example.model;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Map;

/**
 * @author huangy
 * @description
 * @since 2023/2/22 19:56
 **/
@Data
@Document(indexName = "userinfo")
public class User {

    //id
    @Id
    @Field(store = true, type = FieldType.Keyword)
    private long id;

    //名称
    @Field(store = true, type = FieldType.Keyword)
    private String name;

    @Field(store = true, type = FieldType.Integer)
    private int age;

    //身份信息
    @Field(store = true, type = FieldType.Text)
    private CardInfo cardInfo;

    //道具信息
    @Field(store = true, type = FieldType.Keyword)
    private Map<String, String> props;
}
